<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>添加印章</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/index.css">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script type="text/javascript" src="/asset/js/jquery-3.3.1.min.js"></script>
	<script src="/asset/layui/layui.js"></script>
    <script src="/asset/js/common.js"></script>
</head>
<body >
<div class="x-body">

	<form class="layui-form">
		  <input type="hidden" name="devicesTakeId" value="${devicesTake.devicesTakeId}">
          <div class="layui-form-item">
          	  <label for="model" class="layui-form-label">外带印章</label>
              <div class="layui-input-inline layui-form-mid layui-word-aux">
                  ${seal.sealName}
              </div>
          </div>
          
          <div class="layui-form-item">
          	  <label for="model" class="layui-form-label">领取时间</label>
              <div class="layui-input-inline">
                  <input type="text" id="takeTime" name="takeTime"   autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">不填写默认为当前时间</span>
              </div>
          </div>
          
          <div class="layui-form-item">
          	  <label for="model" class="layui-form-label">选择设备</label>
              <div class="layui-input-inline">
                  <select name="devicesId" lay-verify="required">
          				<option value="">请选择设备</option>
          				<#list deviceses as item>
          				<option value="${item.devicesId}">${item.alias!item.devicesCode}</option>
          				</#list>
        		  </select>
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">提交</button>
          </div>
      </form>
</div>

    <script>
        layui.use(['form','layer','laydate'], function(){
            $ = layui.jquery;
          var form = layui.form,layer = layui.layer,laydate = layui.laydate;
        

		lay('#takeTime').each(function(){
			    laydate.render({
			      elem: this
			      ,type: 'datetime'
			      ,trigger: 'click'
			    });
			});
          //监听提交
          form.on('submit(add)', function(data){
            $.ajax({
      			type:"POST", 
      			url:"/custos/take/receive/submit.htm",
      			data:data.field,
      			success:function(result) {
		      
		      		if(result.code=='1'){
		      			layer.alert("操作成功", {icon: 6},function () {
			                // 获得frame索引
			                 window.parent.location.reload();
			                var index = parent.layer.getFrameIndex(window.name);
			                //关闭当前frame
			                parent.layer.close(index);
			            });
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 } 
		    }); 
            
            return false;
          });
          
        });
    </script>

</body>
</html>